home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / int.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-30  |  2.0 KB  |  59 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. #include <stdio.h>
  22. #include <conio.h>
  23. #include <dos.h>
  24. #include <stk.h>
  25. #include <i32.h>
  26.  
  27. #pragma interrupt (AVL_INT23)
  28. void AVL_INT23();               /* User Int 23h protected-mode interrupt handler */
  29.  
  30. void (*AVL_PREV_INT23)();             /* Previous Int 23h protected-mode handler */
  31.  
  32.  
  33. void AVL_INSTALL_I23()               /* Control-C Protected-Mode Handler Example */
  34. {
  35.    AVL_PREV_INT23 = _dos_getvect ( 0x23u  );    /* Save previous handler pointer */
  36.    _dos_setvect ( 0x23u, AVL_INT23 );            /* Install user Int 23h handler */
  37. }
  38.  
  39. void AVL_RESTORE_I23()
  40. {
  41.    _dos_setvect ( 0x23u, AVL_PREV_INT23 );           /* Restore previous handler */
  42. }
  43.  
  44.  
  45. void AVL_INT23 ( void )         /* User Int 23h Protected-Mode Interrupt Handler */
  46. {
  47.    extern int avl_ctrl_c;
  48.    _XSTACK *ebp;                            /* Real-mode handler stack frame */
  49.  
  50.    ebp = (_XSTACK *) _get_stk_frame();           /* Get stack frame address */
  51.  
  52. /*   avl_ctrl_c = 1;   */
  53.  
  54.          /* Perform interrupt handling services, ie, ignore Control-C */
  55.  
  56.    ebp->opts |= _STK_NOINT;                      /* Bypass real-mode handler */
  57. }
  58.  
  59.  
  60.